/*
 * RTClock.c
 *
 *  Created on: May 23, 2021
 *      Author: Rupert
 */

#include "RTClock.h"

static ClockStructure rt_clock = {0, 0, 0};

void UpdateRTClock(void)
{
	rt_clock.micro_seconds ++;
	rt_clock.seconds += rt_clock.micro_seconds / 1000;
	rt_clock.minutes += rt_clock.seconds / 60;
	rt_clock.micro_seconds %= 1000;
	rt_clock.seconds %= 60;
}

void getRTClock(ClockStructure* clk)
{
	clk->micro_seconds = rt_clock.micro_seconds;
	clk->seconds = rt_clock.seconds;
	clk->minutes = rt_clock.minutes;
}
